//
//  MessageManager.m
//  DogeLegs
//
//  Created by 宋华 on 2017/8/29.
//  Copyright © 2017年 宋华. All rights reserved.
//

#import "MessageManager.h"
#import "ChatManager.h"
#import "RecentChatManager.h"

@implementation MessageManager

/**
 *  @brief 发送聊天信息
 *  @param storeId     导购id
 *  @param chatMessage 聊天信息结构体
 *@param isReSend 是否重发
 */
+ (void)sendChatMessage:(NSString*)storeId
            chatMessage:(ChatMessage *)chatMessage
               isReSend:(BOOL)isReSend {
    RecentChatManager *man = [RecentChatManager sharedInstance];
    BOOL exist =[man  isExistRecentDataWithStoreIdAtQueue:storeId];
    
    if (!exist){
        return;
    }
    
    if (isReSend) {
        //更新消息发送状态
        [[ChatManager sharedInstance] updateChatTableBy:chatMessage.dbId storeId:storeId messageState:CHAT_MSG_SENDING];
    }
    
    //发送消息到服务器
    [self sendMessage:chatMessage isReSend:isReSend];

}

+ (void)sendMessage:(ChatMessage *)chatMsg isReSend:(BOOL)isReSend {


}

@end
